<?php
/**
 * This file is part of the Anota project.
 * 2011-2012 Fernando Garcia Huerta <fgarciahue@uoc.edu>
 * 
 * UOC - FUNDAMENTOS DE INFORMÁTICA EN ENTORNOS BIOINFORMÁTICOS - PEC2
 */

/**
 * Stats Module
 * 
 * @package    Anota
 * @subpackage application/module
 * @author     Fernando Garcia Huerta <fgarciahue@uoc.edu>
 */

class AnotaModuleStats extends AnotaModuleBase
{
    /**
     * Index action
     * - get stats info from database
     */
    public function executeIndex()
    {
        // retrieves connection object from config
        $conn = $this->config->getConn();
        
        // retrieves sequence stats
        $query = "SELECT * FROM view_sequence_stats";
        $result = mysql_query($query, $conn);
        $this->sequenceStats = mysql_fetch_assoc($result);
                
        // retrievens proc stats
        $query = "SELECT * FROM view_proc_stats";
        $result = mysql_query($query, $conn);
        $this->procStats = mysql_fetch_assoc($result);
        
        // retrieves option stats
        $query = "SELECT * FROM view_option_stats";
        $result = mysql_query($query, $conn);
        $this->optionStats = mysql_fetch_assoc($result);
    }
}